home *** CD-ROM | disk | FTP | other *** search
/ Secrets of Stargate / STARGATE.iso / mac / STARGATE (5MB Macintosh) / STARGATE (5MB Macintosh).DXR / 00007_IV Scripts.ls < prev    next >
Encoding:
Text File  |  1994-10-19  |  6.6 KB  |  239 lines

  1. on updateIVLinkBack
  2.   global gIVState, gLinkBackMap
  3.   set v to the frameLabel
  4.   delete char 1 to 2 of v
  5.   set gLinkBackMap to "LinkTo (" & QUOTE & "IV" & value(v) & QUOTE & ")" & RETURN & "goToIV " & value(gIVState)
  6. end
  7.  
  8. on openIV
  9.   spinCursor()
  10.   stopAiff()
  11.   LinkTo("IV1")
  12. end
  13.  
  14. on TogglePause spriteNum
  15.   global gMovieState
  16.   set stateData to line the frame of gMovieState
  17.   set the itemDelimiter to "|"
  18.   set theRec to item 1 of stateData
  19.   set startPoint to item 2 of stateData
  20.   set the itemDelimiter to ","
  21.   showIV(theRec)
  22. end
  23.  
  24. on TopicClick theLine
  25.   global gIVTopicRecs, gIVMatchRecs
  26.   if the timer < 20 then
  27.     exit
  28.   end if
  29.   if theLine = -1 then
  30.     exit
  31.   end if
  32.   set theTopic to line theLine of field "Topic IV"
  33.   if (theTopic = EMPTY) or (theTopic = " ") then
  34.     exit
  35.   end if
  36.   spinCursor()
  37.   hilite line theLine of field "Topic IV"
  38.   set tLine to LineOffset(theTopic, field "IVTXT_Q")
  39.   set the itemDelimiter to "|"
  40.   put item tLine of field "IVTXT_PD" into field "Matched IV"
  41.   set gIVMatchRecs to item tLine of field "IVTXT_PR"
  42.   set the itemDelimiter to ","
  43.   hilite line 999 of field "Topic IV"
  44.   showIV(line theLine of gIVTopicRecs)
  45.   startMouse()
  46. end
  47.  
  48. on ivCatClick sN
  49.   global gOnPC, gIVTopicRecs, gIVMatchRecs, gIVState
  50.   if voidp(sN) then
  51.     set sN to the clickOn
  52.   end if
  53.   if the timer < 20 then
  54.     exit
  55.   end if
  56.   hiliteAnim(sN, EMPTY)
  57.   spinCursor()
  58.   set gIVState to sN
  59.   set the movieRate of sprite 35 to 0
  60.   set the visible of sprite 35 to 0
  61.   goToIV(sN)
  62. end
  63.  
  64. on goToIV sN
  65.   global gOnPC, gIVTopicRecs, gIVMatchRecs, gIVState
  66.   set sN to sN - 9
  67.   set thePerson to line sN of field "People IV"
  68.   set pLine to LineOffset(thePerson, field "IVTXT_P")
  69.   set the itemDelimiter to "|"
  70.   set gIVTopicRecs to item pLine of field "IVTXT_QR"
  71.   set allTopics to item pLine of field "IVTXT_QD"
  72.   set the itemDelimiter to ","
  73.   set firstRec to item 1 of gIVTopicRecs
  74.   set theData to line value(firstRec) of field "IVTXT_1"
  75.   set the itemDelimiter to "|"
  76.   set thePerson to item 1 of theData
  77.   set theIVMovie to item 11 of theData
  78.   set theTitle to item 12 of theData
  79.   set the itemDelimiter to ","
  80.   put " " into field "Topic IV"
  81.   put thePerson & " (" & theTitle & ")" into field "IV Caption"
  82.   put allTopics into field "Topic IV"
  83.   resetCursor()
  84.   startMouse()
  85. end
  86.  
  87. on showIV theRec
  88.   global gOnPC, gMovieState
  89.   spinCursor()
  90.   stopAiff()
  91.   hidePuppets()
  92.   pause()
  93.   put field "IVTXT_P" into field "People IV"
  94.   set the visible of sprite 35 to 0
  95.   if (theRec = EMPTY) or voidp(theRec) then
  96.     set firstOpen to 1
  97.     spinCursor()
  98.     repeat with z = 1 to 10
  99.       set theData to line value(z) of field "IVTXT_1"
  100.       if not (theData = EMPTY) then
  101.         exit repeat
  102.       end if
  103.     end repeat
  104.   else
  105.     set theData to line value(theRec) of field "IVTXT_1"
  106.     set firstOpen to 0
  107.   end if
  108.   spinCursor()
  109.   set the itemDelimiter to "|"
  110.   set thePerson to item 1 of theData
  111.   set theIVMovie to item 11 of theData
  112.   set theTitle to item 12 of theData
  113.   set the itemDelimiter to ","
  114.   if the frame <> label("IV" & theIVMovie) then
  115.     spinCursor()
  116.     set the visible of sprite 35 to 0
  117.     if not firstOpen then
  118.       put thePerson & " (" & theTitle & ")" into field "IV Caption"
  119.     end if
  120.     LinkTo("IV" & theIVMovie)
  121.   end if
  122.   pause()
  123.   spinCursor()
  124.   set the startTime of sprite 35 to 0
  125.   set the stopTime of sprite 35 to 0
  126.   updateStage()
  127.   continue()
  128.   put value(theRec) into item 1 of line the frame of gMovieState
  129.   if not ((theRec = EMPTY) or voidp(theRec)) then
  130.     updateIV(theRec)
  131.   else
  132.     resetCursor()
  133.   end if
  134. end
  135.  
  136. on updateIV theRec, startPoint
  137.   global gOnPC, gMovieState, gSysVol, gMovieStartMod
  138.   spinCursor()
  139.   debug("R: " & theRec)
  140.   set stateLine to the frame
  141.   set oldState to line stateLine of gMovieState
  142.   set the movieRate of sprite 35 to 0
  143.   set the visible of sprite 35 to 0
  144.   set theData to line value(theRec) of field "IVTXT_1"
  145.   set the itemDelimiter to "|"
  146.   set oldRec to item 1 of oldState
  147.   set thePerson to item 1 of theData
  148.   set sFrame to value(item 2 of theData)
  149.   set newState to EMPTY
  150.   put theRec into item 1 of newState
  151.   put sFrame into item 2 of newState
  152.   if not ((startPoint = EMPTY) or voidp(startPoint)) then
  153.     if startPoint > 0 then
  154.       set sFrame to value(startPoint)
  155.     end if
  156.   else
  157.     if theRec = oldRec then
  158.       set temp to item 2 of oldState
  159.       if temp > 0 then
  160.         set sFrame to value(temp)
  161.       end if
  162.     end if
  163.   end if
  164.   set eFrame to value(item 3 of theData)
  165.   set theTopic to item 4 of theData
  166.   set theID to item 5 of theData
  167.   set eventList to item 6 of theData
  168.   set theDesc to item 7 of theData
  169.   set theDurSecs to item 8 of theData
  170.   set theVolume to item 10 of theData
  171.   set theIVMovie to item 11 of theData
  172.   set theTitle to item 12 of theData
  173.   set ignoreFudge to value(item 13 of theData)
  174.   put theData & RETURN
  175.   set the itemDelimiter to ","
  176.   set eventItem to 1
  177.   set nextEvent to item eventItem of eventList
  178.   set eventFrame to word 1 of nextEvent
  179.   delete word 1 of nextEvent
  180.   spinCursor()
  181.   set tempDur to the duration of cast the castNum of sprite 35
  182.   if not ignoreFudge then
  183.     set sFrame to sFrame + gMovieStartMod
  184.     set eFrame to eFrame - 180
  185.     if eFrame > tempDur then
  186.       set eFrame to tempDur - 180
  187.     end if
  188.   end if
  189.   if eFrame > tempDur then
  190.     set eFrame to tempDur
  191.   end if
  192.   put sFrame && eFrame && ignoreFudge
  193.   put eFrame && "End" after eventList
  194.   set the movieTime of sprite 35 to sFrame
  195.   set the visible of sprite 35 to 1
  196.   if theVolume = EMPTY then
  197.     set theVolume to gSysVol
  198.   else
  199.     set theVolume to integer(gSysVol * (float(theVolume) / float(255)))
  200.   end if
  201.   set the volume of sprite 35 to theVolume
  202.   updatePalette()
  203.   if theDesc = EMPTY then
  204.     set theDesc to theTopic
  205.   end if
  206.   put thePerson & " (" & theTitle & ")" & RETURN & theDesc & "    " & theDurSecs & " seconds" into field "IV Caption"
  207.   updateStage()
  208.   stopCursor()
  209.   set letPass to 0
  210.   preRollMov(35)
  211.   set continue to 1
  212.   repeat while continue
  213.     if the mouseDown = 1 then
  214.       set letPass to 1
  215.       set the movieRate of sprite 35 to 0
  216.       set the itemDelimiter to "|"
  217.       put the movieTime of sprite 35 into item 2 of newState
  218.       set the itemDelimiter to ","
  219.       exit repeat
  220.     end if
  221.     set cT to the movieTime of sprite 35
  222.     if cT >= eventFrame then
  223.       set the movieRate of sprite 35 to 0
  224.       if nextEvent = "End" then
  225.         set continue to 0
  226.       else
  227.         set nextEvent to item eventItem of eventList
  228.         set eventFrame to word 1 of nextEvent
  229.         delete word 1 of nextEvent
  230.         set the movieRate of sprite 35 to 1
  231.       end if
  232.     end if
  233.     updateStage()
  234.   end repeat
  235.   put thePerson & " (" & theTitle & ")" into field "IV Caption"
  236.   put newState into line stateLine of gMovieState
  237.   resetCursor()
  238. end
  239.